package com.example.hand.springboot_demo.domain.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;

@PropertySource(value = "classpath:properties/person.properties")

@Component
//@ConfigurationProperties("person1")
public class Person {

//    @Value("${person1.name}")
    @Value("${person1.lastName}")
    private String lastName;
    @Value("${person1.list}")
    private List<Integer> list;
//    @Value("")
//    @Value(value = "#{person1.eat}")
    private Eat eat;

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public List<Integer> getList() {
        return list;
    }

    public void setList(List<Integer> list) {
        this.list = list;
    }

    public Eat getEat() {
        return eat;
    }

    public void setEat(Eat eat) {
        this.eat = eat;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + lastName + '\'' +
                ", list=" + list +
                ", eat=" + eat +
                '}';
    }
}
